package com.example.springboot004extensionpoint.applicationListener;

import com.example.springboot004extensionpoint.beanFactoryPostProcessor.Person;
import com.example.springboot004extensionpoint.bootstrapRegistryInitializer.User;
import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;

public class StartedEventApplicationListener implements ApplicationListener<ApplicationStartedEvent> {
    @Override
    public void onApplicationEvent(ApplicationStartedEvent event) {
        User u1 = event.getApplicationContext().getBean("myUser", User.class);
        System.out.println("KoalaCustom *** StartedEventApplicationListener === " +u1.getName());

        Person p1 = event.getApplicationContext().getBean("person", Person.class);
        System.out.println("KoalaCustom *** StartedEventApplicationListener === " +p1.getName());
    }
}
